<template>
    <div>
        <el-menu default-active="/home" class="el-menu-vertical-demo" background-color="#33cccc" text-color="#fff"
            active-text-color="#ff3366" unique-opened router>
            <el-menu-item index="/home">
                <i class="el-icon-s-flag"></i>
                <span slot="title">首页</span>
            </el-menu-item>
            <el-submenu :index="item.id.toString()" v-for="item in mu" :key="item.id">
                <template slot="title">
                    <i :class="item.icon"></i>
                    <span>{{item.title}}</span>
                </template>
                <el-menu-item v-for="it in item.children" :key="it.id" :index="it.url">{{it.title}}</el-menu-item>
            </el-submenu>
        </el-menu>
    </div>
</template>


<script>
import { mapGetters} from 'vuex'
export default {
    data() {
        return {
            mu:[],
            shop:[]
        };
    },
    mounted(){
        if(sessionStorage.getItem('user')){
            // console.log(JSON.parse(sessionStorage.getItem('user')));
            let userinfo =JSON.parse(sessionStorage.getItem('user'));
            this.mu =userinfo.menus
            // this.shop=menus_url
        }
    },
    methods: {
    },
    components: {
    },
}
</script>

<style scoped>
.el-menu {
    height: 570px;
}
</style>
